﻿using System.Runtime.InteropServices;
using System.Text;
public class INI
{
    private string xe125219852864557;
    public string Path
    {
        get
        {
            return this.xe125219852864557;
        }
        set
        {
            this.xe125219852864557 = value;
        }
    }
    public INI(string INIPath)
    {
        this.xe125219852864557 = INIPath;
    }
    [DllImport("kernel32")]
    public static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
    [DllImport("kernel32")]
    public static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
    [DllImport("kernel32")]
    public static extern int GetPrivateProfileString(string section, string key, string defVal, byte[] retVal, int size, string filePath);
    public void IniWriteValue(string Section, string Key, string Value)
    {
        INI.WritePrivateProfileString(Section, Key, Value, this.xe125219852864557);
    }
    public string IniReadValue(string Section, string Key)
    {
        StringBuilder stringBuilder = new StringBuilder(2550);
        INI.GetPrivateProfileString(Section, Key, "", stringBuilder, 2550, this.xe125219852864557);
        return stringBuilder.ToString();
    }
    public byte[] IniReadValues(string section, string key)
    {
        byte[] array = new byte[2550];
        INI.GetPrivateProfileString(section, key, "", array, 2550, this.xe125219852864557);
        return array;
    }
    public void ClearAllSection()
    {
        this.IniWriteValue(null, null, null);
    }
    public void ClearSection(string Section)
    {
        this.IniWriteValue(Section, null, null);
    }
}